document.addEventListener("DOMContentLoaded", function () {
    list = []
    list.push(document.createElement('p'))
    list[0].innerHTML = '<hr />'
    list[0].style.color = 'black'
    const additionalWorkSource = makeTitlePageMetaEntry("WorkSource")
    if (additionalWorkSource) {
        list.push(additionalWorkSource)
    }
    const additionalCitations = makeTitlePageMetaEntry("Citations")
    if (additionalCitations) {
        list.push(additionalCitations)
    }
    if (list.length < 2) {
        return
    }
    const titleElement = document.querySelector('section'); /* 找到第一个 section */
    if (titleElement) {
        const additionalMeta = document.createElement('div')
        additionalMeta.className = "TitlePageMetaDiv"
        list.forEach(i => {
            additionalMeta.appendChild(i)
        });
        titleElement.appendChild(additionalMeta)
    }
});
function makeTitlePageMetaEntry(name) {
    const metadata = document.querySelector(`meta[name=${name}]`)
    if (!metadata) {
        return null
    }
    var entry = document.createElement('p')
    entry.className = "TitlePageMetaText"
    entry.innerHTML = metadata.content
    return entry
}